//调价结算
import service from '@/utils/request'
const { httpPost, httpGet } = service
import { selectDataClient } from '@/utils/common'
const request = {
    getData (params) {
        return httpPost({
            url: '/materialsettle/AdjustmentSettlement/listByEntity',
            params
        })
    },
    // 新增调价结算
    basicInfoAdd (params) {
        return httpPost({
            url: '/materialsettle/AdjustmentSettlement/create',
            params
        })
    },
    // 修改调价结算基本信息
    basicInfoSave (params) {
        return httpPost({
            url: '/materialsettle/AdjustmentSettlement/update',
            params
        })
    },
    // 获取调价结算基本信息
    getBasicInfo (id) {
        return httpGet({
            url: '/materialsettle/AdjustmentSettlement/findById',
            params: {
                id
            }
        })
    },
    // 删除
    basicInfoDelete (id) {
        return httpGet({
            url: '/materialsettle/AdjustmentSettlement/delete',
            params: {
                id
            }
        })
    },
    // 获取结算明细
    getSettlementList (id) {
        return httpGet({
            url: '/materialsettle/AdjustmentSettlement/getListById',
            params: {
                id
            }
        })
    },
    // 修改结算明细
    saveSettlement (params) {
        return httpPost({
            url: '/materialsettle/AdjustmentSettlement/updateList',
            params
        })
    },
    // 获取服务费用
    getServeList (id) {
        return httpGet({
            url: '/materialsettle/AdjustmentSettlement/getServiceFeeListById',
            params: {
                id
            }
        })
    },
    // 修改服务费用
    saveServiceFee (params) {
        return httpPost({
            url: '/materialsettle/AdjustmentSettlement/updateServiceFeeList',
            params
        })
    },
    // 调价结算基本信息处选择调价验收弹出弹窗选择数据
    getSettlementDialog (data, dtlIds) {
        return selectDataClient({
            SelectServiceToken: '/materialsettle/adjustmentAcceptance/listSettleableDtlsForSelect', // 客户端对应方法名,吉吉还未写好后端接口
            IsSingleMode: false, // 是否单选 true 单选 false 多选
            SelectedIDs: dtlIds, // 已选中id(注意：是上一次已选中的id，不是要传的参数，如果第一次选，则传[]) // 这个是客户端给的,没有则为空
            InitParamsStr: JSON.stringify(data), // 接口参数(name为模拟参数)
            Title: '选择结算明细' // 标题
        })
    },

    // 冲红单
    redSingle (billId) {
        return httpGet({
            url: '/materialsettle/AdjustmentSettlement/initRedBill',
            params: {
                billId
            }
        })
    },
}

export default request